<%--
    Document   : admin
    Created on : Oct 16, 2011, 5:11:10 PM
    Author     : VIC
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="Beans.*,java.util.Vector,Models.*"%>
<!--
Kiểm tra user vào trang này có quyền quản trị viên không ?
-->
<%
            NhanVien nv = new NhanVien();
            if (session.getAttribute("nv") == null) {
                response.sendRedirect("../index.jsp");
                return;
            } else {
                nv = (NhanVien) session.getAttribute("nv");
                if (nv == null || nv.getMaNNV() != 4) {
                    response.sendRedirect("../index.jsp");
                    return;
                }
            }

%>
<!--
   Danh sách các tham số hệ thống ở trang này :
   area signout
-->

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>i-Order</title>
        <link rel="icon" href="../images/icon.png" />
        <link rel="shortcut icon" href="../images/icon.png" />
        <link rel="apple-touch-icon" href="../images/icon.png"/>
        <link rel="apple-touch-icon-precomposed" href="../images/icon.png"/>
        <link href="../css/style.css" type="text/css" rel="stylesheet" />
        <link href="../css/ui-darkness/jquery-ui-1.8.16.custom.css" type="text/css" rel="stylesheet" />
        <link href="../css/jquery.alerts.css" type="text/css" rel="stylesheet" />        
        <script src="../js/jquery-1.5.1.min.js" type="text/javascript"></script>
        <script src="../js/jquery-ui-1.8.16.custom.min.js" type="text/javascript"></script>
        
        <script src="../js/jquery.ui.datepicker-vi.js" type="text/javascript"></script>
        <script src="../js/jquery.ui.datepicker-fr.js" type="text/javascript"></script>
        <script src="../js/jquery.ui.datepicker-zh-CN.js" type="text/javascript"></script>
        <script src="../js/jquery.alerts.js" type="text/javascript"></script>
        <script src="../js/msg.js" type="text/javascript"></script>
        <script src="../js/jquery.simplemodal.js" type="text/javascript"></script>
        <script src="../js/ajax.js" type="text/javascript"></script>
        <title>JSP Page</title>
        <script type="text/javascript">
            $().ready(function() {
                $(".toggle").click(function(){
                    $(".content").slideToggle("medium");
                });
                $('dd:not(:first)').hide();
                $('dt a').click(function(){
                    $('dd:visible').slideUp('medium');
                    $('dt.current').removeClass('current');
                    if($(this).parent().next().is(':hidden')==true){
                        $(this).parent().addClass('current').next().slideDown('medium');
                    }
                });
                $('#sidebar ul li a').click(function(){
                    $('#sidebar li.current').removeClass('current');
                    $(this).parent().addClass('current');
                });

            });
        </script>
        <script type="text/javascript">
            var id;
            var idd;
            var ht;
            jQuery(document).ready(function() {
                Cook();
                if(id == null){                    
                    id = setInterval( "Cook()", 2000 );
                }
            });
            function showmodalbox(){
                $('#mbcook').modal(
                {
                        close:false,
                        closeHTML:null,
                        overlayClose:false
                }
                );
            }
            function closemodal(){
                $.modal.close();
            }
        </script>
    </head>
    <%
                int langid = (Integer) session.getAttribute("langid"); // ngôn ngữ hiện tại
                String dsts = " 'refresh',  'notice', 'msgpass', 'checksubmitmsg', 'msgdetailuser', 'save', 'phonenumber', 'address', 'newpass', 'nameofuser', 'account', 'hello',  'nofood', 'signout', 'cook' ";
                ThamSoHT[] mdsts = ThamSoHT_Model.DSThamSo(dsts, langid); // mảng chứa các tham số của trang này.
                String account = mdsts[0].getTenTS();
                String address = mdsts[1].getTenTS();
                String checksubmitmsg = mdsts[2].getTenTS();
                String cook = mdsts[3].getTenTS();
                String hello = mdsts[4].getTenTS();
                String msgdetailuser = mdsts[5].getTenTS();
                String msgpass = mdsts[6].getTenTS();
                String nameofuser = mdsts[7].getTenTS();
                String newpass = mdsts[8].getTenTS();
                String nofood = mdsts[9].getTenTS();
                String notice = mdsts[10].getTenTS();
                String phonenumber = mdsts[11].getTenTS();
                String refresh = mdsts[12].getTenTS();
                String save = mdsts[13].getTenTS();
                String signout = mdsts[14].getTenTS();

                String detailusermsg = notice + "/" + msgdetailuser;
                String msgchecksubmit = notice + "/" + checksubmitmsg;
                String passmsg = notice + "/" + msgpass;
    %>
    <body>
        <div id="head">
            <div class="left">
                <a class="button profile" href="">
                    <img style=" margin-top: 4px;" alt="" src="../images/huser.png">
                </a>
                <%=hello %>
                <a href="#"><%=nv.getHoTen()%></a>
            </div>
            <div class="userNav">
                <ul>
                    <li>
                        <a href="#" onclick="ShowChangePass()">
                            <img alt="" src="../images/settings.png"><span><%=account%></span>
                        </a>
                        <div id="changepass" style="width: 355px; margin-top: 41px; margin-left: -130px !important; background: url('../images/topNav.jpg') repeat; ">
                            <form action="" id="changepasss">
                            <div style=" margin: 10px 10px 8px;">
                                <div style=" width: 120px; float: left; font-size: 13px; padding-left: 5px;"><%=nameofuser%></div>
                                <input style=" width: 200px; margin-top: 8px;" type="text" class="text tennv" name="tennv" value="<%=NhanVien_Model.LayTenNV(nv.getMaNV()) %>" >
                            </div>
                            <div style=" margin: 10px 10px 8px; clear: both;">
                                <div style=" width: 120px; float: left; font-size: 13px;padding-left: 5px;"><%=newpass%></div>
                                <input style=" width: 200px; margin-top: 8px;" type="text" class="text newpass" name="newpass" >
                            </div>
                            <div style=" margin: 10px 10px 8px; clear: both;">
                                <div style=" width: 120px; float: left; font-size: 13px;padding-left: 5px;"><%=address%></div>
                                <input style=" width: 200px; margin-top: 8px;" type="text" class="text diachi" name="diachi" value="<%=NhanVien_Model.LayDiaChi(nv.getMaNV()) %>">
                            </div>
                            <div style=" margin: 10px 10px 8px; clear: both;">
                                <div style=" width: 120px; float: left; font-size: 13px;padding-left: 5px;"><%=phonenumber%></div>
                                <input style=" width: 200px; margin-top: 8px;" type="text" class="text sodt" name="sodt" onkeypress="return keypress(event)" value="<%=NhanVien_Model.LaySoDT(nv.getMaNV()) %> " >
                            </div>
                            <div class="cb"></div>
                                <input style=" margin-left: 135px; margin-bottom: 10px; margin-top: 10px;" class="button" type="button"  value="<%=save%>" lang="<%=passmsg%>" alt="<%=msgchecksubmit%>" id="<%=detailusermsg%>" onclick="Changepass(this.lang, this.alt, this.id)">
                            </form>

                        </div>
                    </li>
                    <li>
                        <a href="../DangNhap_Controller?action=logout">
                            <img alt="" src="../images/lgout.png"><span><%=signout%></span>
                        </a>
                    </li>
                </ul>
            </div>
        </div>
        <div id="content" class="white" style=" margin: 0 30px;">
            <h1><img style=" margin-top: 6px; margin-right: 13px; opacity: 0.8;" alt="" src="../images/chef.png"><%=cook%></h1>
            <div class="refresh" onclick="Refresh()"><a href="#" style=" text-decoration: none;"><img alt="" src="../images/refresh1.png" style=" margin-right: 5px; float: left; opacity: 0.5;"><div class="ref" style="text-align: left; width: 100px; padding-top: 7px; color: #ff0000; opacity: 0.8; font-size: 13px;"><%=refresh%></div></a></div>
            <div class="cb"></div>
             <div id="mbcook" style=" display: none;">                
            </div>
            <div class="bloc" style=" margin-top: 15px;">
                <div id="rscook" ></div>            
            </div>
        </div>
    </body>    
</html>

